/*
package org.itboys.core.service.mongo.web;

import org.itboys.commons.utils.tools.ListUtil;
import org.itboys.commons.utils.tools.LongUtil;
import org.itboys.core.entity.mongo.SundayFeedback;
import org.itboys.core.entity.mongo.SundayFeedbackAns;
import org.itboys.mongodb.core.MongoDataSource;
import org.itboys.mongodb.service.BaseMongoService;
import org.itboys.param.ParamUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

*/
/**
 * Auther: 罗尧坤
 * Date: 2018/8/6
 * Description: 用户反馈回答服务类
 *//*

@Service
public class SundayFeedbackAnsService extends BaseMongoService<SundayFeedbackAns> {

    @Autowired
    private SundayFeedbackService feedbackService;

    @Resource(name = "mobileDs")
    private MongoDataSource mobileDataSource;

    @Override
    protected MongoDataSource getMongoDataSource() {
        return mobileDataSource;
    }

    @Override
    protected Class<SundayFeedbackAns> getEntityClass() {
        return SundayFeedbackAns.class;
    }

    */
/**
     * 保存或修改用户反馈记录
     *
     * @param ans
     *//*

    public void save(SundayFeedbackAns ans) {
        SundayFeedback feedback = feedbackService.getById(ans.getFeedbackId());
        feedback.setIsAnswerd(1);
        feedback.setStatus(1);
        feedbackService.updateExceptEmpty(ans.getFeedbackId(), feedback);

        if (LongUtil.isNotZreo(ans.getId())) {
            super.updateExceptEmpty(ans.getId(), ans);
        } else {
            super.save(ans);
        }
    }

    */
/**
     * 查询单个用户反馈对象
     *
     * @param id
     * @return
     *//*

    public SundayFeedbackAns findOne(HttpServletRequest request, Long id) {
        Map<String, Object> param = ParamUtil.packageMongoExactParam(request);
        param.put("feedbackId", id);
        List<SundayFeedbackAns> list = super.list(param);

        SundayFeedback feedback = feedbackService.getById(id);

        SundayFeedbackAns feedbackAns = new SundayFeedbackAns();

        if (ListUtil.isNotNull(list)) {
            feedbackAns = list.get(0);
            feedbackAns.setFeedbackId(id);
            return feedbackAns;
        } else {
            feedbackAns = new SundayFeedbackAns();
            feedbackAns.setId(0);
            feedbackAns.setFeedbackId(id);
            feedbackAns.setTags(feedback.getTags());
            feedbackAns.setAdvice(feedback.getAdvice());
            return feedbackAns;

        }

    }

}
*/
